//编写类A01，定义方法max，实现求某个double数组的最大值，并返回
public class Homework11 {
    public static void main(String[] args) {
        double[] arr = {20.1, 30, 41.8, 12.9, 50.3, 9.9, 27.8};
        A01 a01 = new A01(arr);
        double max = a01.max();
        System.out.println("数组的最大值为：" + max);
    }
}

class A01 {
    double[] arr;
    A01(double[] arr) {
        this.arr = arr;
    }
   public double max() {
        double max = this.arr[0];
       for (int i = 0; i < arr.length; i++) {
           if (arr[i] > max) {
               max = arr[i];
           }
       }
       return max;
   }
}
